<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

let url="http://www.aaa.com?id=zhangsan&name=%E5%BC%A0%E4%B8%89&age=35&%E5%BC%A0%E4%B8%89=666";
function queryString2Obj(url){
	let str=url.split("?")[1];
	let items=str.split("&");
	let result={}
	let arr=[];
	for(let i=0; i<items.length; i++){
		arr=items[i].split('=');
		result[decodeURIComponent(arr[0])]=decodeURIComponent(arr[1]);
	}
	
	return result;
}
 
let obj=queryString2Obj(url);
console.log(obj)
    </script>
</body>
</html>